package com.ccit.model;

import com.baomidou.mybatisplus.annotation.*;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel("商品")
@TableName("goods")
public class Goods {

    @TableId(value = "id", type = IdType.AUTO)
    private Long id;

    @ApiModelProperty(value = "商品名称")
    @TableField("name")
    private String name;

    @ApiModelProperty(value = "商品库存")
    @TableField("stock")
    private Integer stock;

    @ApiModelProperty(value = "商品价格")
    @TableField("price")
    private Double price;

    @ApiModelProperty(value = "供应商")
    @TableField("supplier")
    private String  supplier;

    @ApiModelProperty(value = "商品图片")
    @TableField("img_url")
    private String imgUrl;

    @TableLogic//逻辑删除注解
    @ApiModelProperty(value = "商品逻辑删除(下架),1 已删除  0 未删除")
    @TableField("deleted")
    @JsonIgnoreProperties
    private Integer deleted;

}
